import { S } from '../../s';
import { IPSSysPanelModel } from './ipssys-panel-model';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSSysPanelModelImpl
  extends PSModelObjectImpl
  implements IPSSysPanelModel
{
  get codeName(): string {
    return this.M.codeName;
  }

  get dataType():
    | 'OBJECT'
    | 'OBJECTARRAY'
    | 'STRING'
    | 'STRINGARRAY'
    | 'INT'
    | 'INTARRAY'
    | 'NUMBER'
    | 'NUMBERARRAY'
    | 'BOOL' {
    return this.M.dataType;
  }

  get type(): 'PANELMODEL' | 'VIEWMODEL' | 'CTRLMODEL' {
    return this.M.type;
  }

  get ctrlModel(): boolean {
    return this.M.ctrlModel != null ? this.M.ctrlModel : false;
  }

  get panelModel(): boolean {
    return this.M.panelModel != null ? this.M.panelModel : false;
  }

  get viewModel(): boolean {
    return this.M.viewModel != null ? this.M.viewModel : false;
  }
  get cls(): string {
    return 'PSSysPanelModelImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._18a || cls == S._18b) return true;
    return super.instanceof(cls);
  }
}
